package tr.richfacesext.examples;

import java.util.ArrayList;
import java.util.List;

import tr.richfacesext.components.chart.ChartHelper;

import com.googlecode.charts4j.PieChart;


/**
 * 
 * @author mert
 *
 */
public class ChartController {

	public PieChart getPieChart() {
		return ChartHelper.createPieChart(getNumbers(), getChartColors(), getChartLegends());
	}
	
	public PieChart getBarChart() {
		return null;
	}

	private List<Number> getNumbers() {
		List<Number> numbers = new ArrayList<Number>();
		numbers.add(56);
		numbers.add(30);
		numbers.add(14);
		
		return numbers;
	}
	
	private List<String> getChartColors() {
		List<String> colors = new ArrayList<String>();
		colors.add("FF3300");
		colors.add("FFFF33");
		colors.add("3333FF");
		
		return colors;
	}
	
	private List<String> getChartLegends() {
		List<String> legends = new ArrayList<String>();
		legends.add("Rich Faces");
		legends.add("Some Faces");
		legends.add("Many Faces");
		
		return legends;
	}
}